
//相关业务逻辑
$(function(){
    page.bind();
});

var page={//页面总变量
		bind:function(){
//			关闭模态框清除数据
			$("#reportModelColse").bind("click",function(){
				$("#reportReasonModel").modal("hide");
				$("#returnException").html("");
				$("#myModalLabel").text("");
			});
			
			$("#addPeopleFile").bind("click",function(){
//				$("#reportReasonModel").modal("show");
				var fileName=$("#filename").val();
				if(!fileName){
					layAlert("请选择上传文件");
					return false;
				}
				ajaxUtil.fileAjax('user/addPeopleByFile','filename',function(data){
					if(data.length<=0){
						layAlert("上传成功");
					}else{
						var title=data.length+"人上传失败！"
						var html="<table>";
						for(var i=0;i<data.length;i++){
							html+="<tr><td>"+data[i].userName+
							      "</td><td>"+data[i].phone+
							      "</td><td><span style='color:red'></span></td></tr>";
						}
						html+="</table>";
						console.log(html);
						$("#returnException").html(html);
						console.log($("#returnException").html());
						$("#myModalLabel").text(title);
						$("#reportReasonModel").modal("show");
					}
				});
			});
		}
}